﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace Hack.Attributes
{
    public class Extension : Attribute
    {
        [DefaultValue("")]
        public string Description { get; internal set; }
        public Extension(string desc)
        {
            this.Description = desc;
        }
        public Extension() { }
    }
    public class API : Attribute
    {
        [DefaultValue("")]
        public string ProviderUrl { get; set; }
        public OrginalAuthor OrginalAuthor { get; set; }
    }
    public class OrginalAuthor : Attribute
    {
        [DefaultValue("")]
        public string Description { get; set; }
        [DefaultValue("")]
        public string Author { get; set; }
        [DefaultValue("")]
        public string Url { get; set; }
        [DefaultValue("")]
        public string AditionalInfo { get; set; }
    }
    public class Helper : Attribute
    {
        [DefaultValue("")]
        public string Description { get; internal set; }
        public Helper(string desc)
        {
            this.Description = desc;
        }
        public Helper() { }
    }
    public class BytePower : Attribute
    {
        /// <summary>
        /// 1024 bytepower is 1kb
        /// </summary>
        /// <param name="BytePower"></param>
        public BytePower(ulong BytePower)
        {
            this.Power = BytePower;
        }
        public ulong Power { get; internal set; }
    }

    	[Serializable] 
	public class TestFailedException : Exception
	{
		public TestFailedException()
			: base("A BLToolkit Sql error has occurred.")
		{
		}

		public TestFailedException(string message)
			: base(message) 
		{
		}

		[JetBrains.Annotations.StringFormatMethod("message")]
		public TestFailedException(string message, params object[] args)
			: base(string.Format(message, args))
		{
		}

		public TestFailedException(string message, Exception innerException)
			: base(message, innerException)
		{
		}

		public TestFailedException(Exception innerException)
			: base(innerException.Message, innerException)
		{
		}

        protected TestFailedException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
		}
	}
    public class Test : Attribute
    {
        [DefaultValue("")]
        public string Description;
        public bool Run;
        private Type[] _CallArguments;
        private bool _Working;
        public bool Working { get { return this._Working; } set { this._Working = value; } }
        public Type[] CallArguments { get { return this._CallArguments; } set { _CallArguments = value; } }
        public Test(bool working, params Type[] callarguments)
            : this(working)
        {
            _CallArguments = callarguments;
        }
        public Test() : this(true, true) { }
        public Test(bool working)
        {
            this._Working = true;
        }
        public Test(bool working, bool runTest)
            : this(working)
        {
            this.Run = runTest;
        }
        public Test(bool working, bool runTest, params Type[] callarguments)
        {
            this.Working = working;
            this.Run = runTest;
            this.CallArguments = callarguments;
        }
    }
}
